home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assemblers / cas.lha / ex.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-09  |  806 b   |  29 lines

  1. typedef struct Exp *Exp;
  2. typedef enum { NumX, AddrX, SymX, UnX, BinX, CondX } ExpTag;
  3. struct Exp {
  4.    word Hash, Line, File; int Mark:1, Map:1;
  5.    ExpTag Tag; Exp Tail, Next;
  6.    union {
  7.       word Value;
  8.       struct { Segment Seg; word Offset; } Addr;
  9.       Symbol Sym;
  10.       struct { Lexical Op; Exp A, B, C; } Funct;
  11.    } Body;
  12. };
  13. extern Exp ExpHead;
  14.  
  15. #define VALUE(E)  ((E)->Body.Value)
  16. #define SEG(E)    ((E)->Body.Addr.Seg)
  17. #define OFFSET(E) ((E)->Body.Addr.Offset)
  18. #define SYM(E)    ((E)->Body.Sym)
  19. #define OP(E)     ((E)->Body.Funct.Op)
  20. #define ARG1(E)   ((E)->Body.Funct.A)
  21. #define ARG2(E)   ((E)->Body.Funct.B)
  22. #define ARG3(E)   ((E)->Body.Funct.C)
  23.  
  24. extern Exp Parse(int Dir);
  25. extern Exp MakeExp(ExpTag Tag, ...);
  26. extern Exp EvalExp(Exp E);
  27. extern void MarkExp(Exp E);
  28. extern void ExpInit(void);
  29.